package com.learn.base.extrat.v3;
/**
 * 最终重构完成 删除Female.class 和Male.class
 * @author:         cong zhi
 * @createDate:     2022/4/22 17:45
 * @updateUser:     cong zhi
 * @updateDate:     2022/4/22 17:45
 * @updateRemark:   修改内容
 * @version:        v1.0
 */
public class Person {

    private boolean isMale;

    private char code;

    static Person createMale() {
        return new Person(true, 'M');
    }

    static Person createFemale() {
        return new Person(false, 'F');
    }
    public Person(boolean isMale, char code) {
        this.isMale = isMale;
        this.code = code;
    }

    public boolean isMale() {
        return isMale;
    }

    public static void main(String[] args) {
        Person female = Person.createFemale();
        System.out.println(female.isMale);
    }
}
